﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Agresso.Interface.Layer.SQL
{
    public class AlgBatchInputSQL
    {
        public static string Insert()
        {
            return @"
            INSERT INTO algbatchinput
           ([account]
           ,[accountable]
           ,[address]
           ,[allocation_key]
           ,[amount]
           ,[amount_set]
           ,[apar_id]
           ,[apar_id_ref]
           ,[apar_name]
           ,[art_descr]
           ,[article]
           ,[att_1_id]
           ,[att_2_id]
           ,[att_3_id]
           ,[att_4_id]
           ,[att_5_id]
           ,[att_6_id]
           ,[att_7_id]
           ,[bank_account]
           ,[batch_id]
           ,[clearing_code]
           ,[client]
           ,[client_ref]
           ,[confirm_date]
           ,[contract_id]
           ,[control]
           ,[cur_amount]
           ,[currency]
           ,[del_met_descr]
           ,[del_term_descr]
           ,[deliv_addr]
           ,[deliv_attention]
           ,[deliv_countr]
           ,[deliv_date]
           ,[deliv_method]
           ,[deliv_terms]
           ,[delivery_descr]
           ,[dim_1]
           ,[dim_2]
           ,[dim_3]
           ,[dim_4]
           ,[dim_5]
           ,[dim_6]
           ,[dim_7]
           ,[dim_value_1]
           ,[dim_value_2]
           ,[dim_value_3]
           ,[dim_value_4]
           ,[dim_value_5]
           ,[dim_value_6]
           ,[dim_value_7]
           ,[disc_percent]
           ,[discount]
           ,[ean]
           ,[exch_rate]
           ,[ext_ord_ref]
           ,[intrule_id]
           ,[line_no]
           ,[location]
           ,[long_info1]
           ,[long_info2]
           ,[lot]
           ,[main_apar_id]
           ,[mark_attention]
           ,[markings]
           ,[obs_date]
           ,[order_date]
           ,[order_id]
           ,[order_type]
           ,[pay_method]
           ,[pay_temp_id]
           ,[period]
           ,[place]
           ,[province]
           ,[rel_value]
           ,[rent_flag]
           ,[responsible]
           ,[responsible2]
           ,[sequence_no]
           ,[sequence_ref]
           ,[serial_no]
           ,[short_info]
           ,[status]
           ,[sup_article]
           ,[swift]
           ,[tax_code]
           ,[tax_system]
           ,[template_id]
           ,[terms_id]
           ,[text1]
           ,[text2]
           ,[text3]
           ,[text4]
           ,[trans_type]
           ,[unit_code]
           ,[unit_descr]
           ,[unit_price]
           ,[value_1]
           ,[vat_reg_no]
           ,[voucher_ref]
           ,[voucher_type]
           ,[warehouse]
           ,[wf_state]
           ,[zip_code]
           ,[terms_descr]
           ,[ext_order_id])
     VALUES
           (@account
            ,@accountable
            ,@address
            ,@allocation_key
            ,@amount
            ,@amount_set
            ,@apar_id
            ,@apar_id_ref
            ,@apar_name
            ,@art_descr
            ,@article
            ,@att_1_id
            ,@att_2_id
            ,@att_3_id
            ,@att_4_id
            ,@att_5_id
            ,@att_6_id
            ,@att_7_id
            ,@bank_account
            ,@batch_id
            ,@clearing_code
            ,@client
            ,@client_ref
            ,@confirm_date
            ,@contract_id
            ,@control
            ,@cur_amount
            ,@currency
            ,@del_met_descr
            ,@del_term_descr
            ,@deliv_addr
            ,@deliv_attention
            ,@deliv_countr
            ,@deliv_date
            ,@deliv_method
            ,@deliv_terms
            ,@delivery_descr
            ,@dim_1
            ,@dim_2
            ,@dim_3
            ,@dim_4
            ,@dim_5
            ,@dim_6
            ,@dim_7
            ,@dim_value_1
            ,@dim_value_2
            ,@dim_value_3
            ,@dim_value_4
            ,@dim_value_5
            ,@dim_value_6
            ,@dim_value_7
            ,@disc_percent
            ,@discount
            ,@ean
            ,@exch_rate
            ,@ext_ord_ref
            ,@intrule_id
            ,@line_no
            ,@location
            ,@long_info1
            ,@long_info2
            ,@lot
            ,@main_apar_id
            ,@mark_attention
            ,@markings
            ,@obs_date
            ,@order_date
            ,@order_id
            ,@order_type
            ,@pay_method
            ,@pay_temp_id
            ,@period
            ,@place
            ,@province
            ,@rel_value
            ,@rent_flag
            ,@responsible
            ,@responsible2
            ,@sequence_no
            ,@sequence_ref
            ,@serial_no
            ,@short_info
            ,@status
            ,@sup_article
            ,@swift
            ,@tax_code
            ,@tax_system
            ,@template_id
            ,@terms_id
            ,@text1
            ,@text2
            ,@text3
            ,@text4
            ,@trans_type
            ,@unit_code
            ,@unit_descr
            ,@unit_price
            ,@value_1
            ,@vat_reg_no
            ,@voucher_ref
            ,@voucher_type
            ,@warehouse
            ,@wf_state
            ,@zip_code
            ,@terms_descr
            ,@ext_order_id
            )
            ";
        }

        public static string GetMaxAgrtIDAcrBatchInputSQL()
        {
            return @"select MAX(agrtid) from algbatchinput";
        }

        public static string InsertAlgBatchInputInterfaceSQL()
        {
            return @"
            INSERT INTO i_algbatchinput
           ([account]
           ,[accountable]
           ,[address]
           ,[allocation_key]
           ,[amount]
           ,[amount_set]
           ,[apar_id]
           ,[apar_id_ref]
           ,[apar_name]
           ,[art_descr]
           ,[article]
           ,[att_1_id]
           ,[att_2_id]
           ,[att_3_id]
           ,[att_4_id]
           ,[att_5_id]
           ,[att_6_id]
           ,[att_7_id]
           ,[bank_account]
           ,[batch_id]
           ,[clearing_code]
           ,[client]
           ,[client_ref]
           ,[confirm_date]
           ,[contract_id]
           ,[control]
           ,[cur_amount]
           ,[currency]
           ,[del_met_descr]
           ,[del_term_descr]
           ,[deliv_addr]
           ,[deliv_attention]
           ,[deliv_countr]
           ,[deliv_date]
           ,[deliv_method]
           ,[deliv_terms]
           ,[delivery_descr]
           ,[dim_1]
           ,[dim_2]
           ,[dim_3]
           ,[dim_4]
           ,[dim_5]
           ,[dim_6]
           ,[dim_7]
           ,[dim_value_1]
           ,[dim_value_2]
           ,[dim_value_3]
           ,[dim_value_4]
           ,[dim_value_5]
           ,[dim_value_6]
           ,[dim_value_7]
           ,[disc_percent]
           ,[discount]
           ,[ean]
           ,[exch_rate]
           ,[ext_ord_ref]
           ,[intrule_id]
           ,[line_no]
           ,[location]
           ,[long_info1]
           ,[long_info2]
           ,[lot]
           ,[main_apar_id]
           ,[mark_attention]
           ,[markings]
           ,[obs_date]
           ,[order_date]
           ,[order_id]
           ,[order_type]
           ,[pay_method]
           ,[pay_temp_id]
           ,[period]
           ,[place]
           ,[province]
           ,[rel_value]
           ,[rent_flag]
           ,[responsible]
           ,[responsible2]
           ,[sequence_no]
           ,[sequence_ref]
           ,[serial_no]
           ,[short_info]
           ,[status]
           ,[sup_article]
           ,[swift]
           ,[tax_code]
           ,[tax_system]
           ,[template_id]
           ,[terms_id]
           ,[text1]
           ,[text2]
           ,[text3]
           ,[text4]
           ,[trans_type]
           ,[unit_code]
           ,[unit_descr]
           ,[unit_price]
           ,[value_1]
           ,[vat_reg_no]
           ,[voucher_ref]
           ,[voucher_type]
           ,[warehouse]
           ,[wf_state]
           ,[zip_code]
           ,[terms_descr]
           ,[ext_order_id]
            ,[agrtid])
     VALUES
           (@account
            ,@accountable
            ,@address
            ,@allocation_key
            ,@amount
            ,@amount_set
            ,@apar_id
            ,@apar_id_ref
            ,@apar_name
            ,@art_descr
            ,@article
            ,@att_1_id
            ,@att_2_id
            ,@att_3_id
            ,@att_4_id
            ,@att_5_id
            ,@att_6_id
            ,@att_7_id
            ,@bank_account
            ,@batch_id
            ,@clearing_code
            ,@client
            ,@client_ref
            ,@confirm_date
            ,@contract_id
            ,@control
            ,@cur_amount
            ,@currency
            ,@del_met_descr
            ,@del_term_descr
            ,@deliv_addr
            ,@deliv_attention
            ,@deliv_countr
            ,@deliv_date
            ,@deliv_method
            ,@deliv_terms
            ,@delivery_descr
            ,@dim_1
            ,@dim_2
            ,@dim_3
            ,@dim_4
            ,@dim_5
            ,@dim_6
            ,@dim_7
            ,@dim_value_1
            ,@dim_value_2
            ,@dim_value_3
            ,@dim_value_4
            ,@dim_value_5
            ,@dim_value_6
            ,@dim_value_7
            ,@disc_percent
            ,@discount
            ,@ean
            ,@exch_rate
            ,@ext_ord_ref
            ,@intrule_id
            ,@line_no
            ,@location
            ,@long_info1
            ,@long_info2
            ,@lot
            ,@main_apar_id
            ,@mark_attention
            ,@markings
            ,@obs_date
            ,@order_date
            ,@order_id
            ,@order_type
            ,@pay_method
            ,@pay_temp_id
            ,@period
            ,@place
            ,@province
            ,@rel_value
            ,@rent_flag
            ,@responsible
            ,@responsible2
            ,@sequence_no
            ,@sequence_ref
            ,@serial_no
            ,@short_info
            ,@status
            ,@sup_article
            ,@swift
            ,@tax_code
            ,@tax_system
            ,@template_id
            ,@terms_id
            ,@text1
            ,@text2
            ,@text3
            ,@text4
            ,@trans_type
            ,@unit_code
            ,@unit_descr
            ,@unit_price
            ,@value_1
            ,@vat_reg_no
            ,@voucher_ref
            ,@voucher_type
            ,@warehouse
            ,@wf_state
            ,@zip_code
            ,@terms_descr
            ,@ext_order_id
            ,@agrtid
            )
            ";
        }
    }
}
